﻿using J.FoodManageSet.Application.Command.DishesCommand;
using J.FoodRepository.InterFace;
using MediatR;
using Microsoft.AspNetCore.Mvc;

namespace J.FoodManageSet.Application.CommandHandler.DishesCommandHandler
{
    public class DishesOpenUpDateCommandHandler : IRequestHandler<DishesOpenUpDateCommand, int>
    {
        private readonly IDishesReposittory _dishesReposittory;

        public DishesOpenUpDateCommandHandler(IDishesReposittory dishesReposittory)
        {
            _dishesReposittory = dishesReposittory;
        }
        public async Task<int> Handle(DishesOpenUpDateCommand request, CancellationToken cancellationToken)
        {
            var list = await _dishesReposittory.DishesOpenUpDate(request.DishId,request.GroupingId);
            return list;
        }
    }
}
